Cascading shadow maps in areas of a three-dimensional environment

ABSTRACT

Disclosed herein is a web-based videoconference system that allows for video avatars to navigate within a virtual environment. Various methods for efficient modeling, rendering, and shading are disclosed herein.

BACKGROUND Field

This field is generally related to computer graphics.

Related Art

Video conferencing involves the reception and transmission ofaudio-video signals by users at different locations for communicationbetween people in real time.

Videoconferencing is widely available on many computing devices from avariety of different services, including the ZOOM service available fromZoom Communications Inc. of San Jose, Calif. Some videoconferencingsoftware, such as the FaceTime application available from Apple Inc. ofCupertino, Calif., comes standard with mobile devices.

In general, these applications operate by displaying video andoutputting audio of other conference participants. When there aremultiple participants, the screen may be divided into a number ofrectangular frames, each displaying video of a participant. Sometimesthese services operate by having a larger frame that presents video ofthe person speaking. As different individuals speak, that frame willswitch between speakers. The application captures video from a cameraintegrated with the user's device and audio from a microphone integratedwith the user's device. The application then transmits that audio andvideo to other applications running on other user's devices.

Many of these videoconferencing applications have a screen sharefunctionality. When a user decides to share their screen (or a portionof their screen), a stream is transmitted to the other users' deviceswith the contents of their screen. In some cases, other users can evencontrol what is on the user's screen. In this way, users can collaborateon a project or make a presentation to the other meeting participants.

Recently, videoconferencing technology has gained importance. Manyworkplaces, trade shows, meetings, conferences, schools, and places ofworship have closed and become available virtually. Virtual conferencesusing videoconferencing technology are increasingly replacing physicalconferences. In addition, this technology provides advantages overphysically meeting in allowing participants to avoid travel andcommuting.

However, often, use of videoconferencing technology causes loss of asense of place. There is an experiential aspect to meeting in personphysically, being in the same place, that is lost when conferences areconducted virtually. There is a social aspect to being able to postureyourself and look at your peers. This feeling of experience is importantin creating relationships and social connections. Yet, this feeling islacking when it comes to conventional videoconferences.

Moreover, due to limitations in network bandwidth and computinghardware, when a lot of streams are placed in the conference, theperformance of many videoconferencing systems begins to slow down. Withmany schools operating entirely virtually, classes of 25 can severelyslow down the school-issued computing devices. Many computing devices,while equipped to handle a video stream from a few participants, areill-equipped to handle a video stream from a dozen or more participants.

By contrast, massively multiplayer online games (MMOG, or MMO) generallycan handle quite a few more than 25 participants. These games often havehundreds or thousands of players on a single server. MMOs often allowplayers to navigate avatars around a virtual world. Sometimes these MMOsallow users to speak with one another or send messages to one another.Examples include the ROBLOX game available from Roblox Corporation ofSan Mateo, Calif., and the MINECRAFT game available from Mojang Studiosof Stockholm, Sweden.

Having bare avatars interact with one another also has limitations interms of social interaction. These avatars usually cannot communicateinadvertent facial expressions. These facial expressions are, however,observable in a videoconference. Some publications may describe havingvideo placed on an avatar in a virtual world, but, these systemstypically require specialized software and have other limitations thatlimit their usefulness.

Though some games work in virtual reality, many virtual reality enginesrequire a large amount of computing power to render the environmentrealistically. Where smaller and lower end devices are used,environments may not be rendered as quickly or realistically.

Improved methods are needed to enable conferencing and VR rendering.

BRIEF SUMMARY

In an embodiment, a computer-implemented method provides for efficientlyrendering shadows in a three-dimensional virtual environment. The methodbegins by rendering, at a first resolution, a first shadow map of afirst area of the three-dimensional virtual environment from aperspective of a light source in the three-dimensional virtualenvironment. The first shadow map specifies a plurality of firstdistances from the light source to objects of the three-dimensionalvirtual environment and the first area being in proximity of a virtualcamera. The method continues by rendering, at a second resolution, asecond shadow map of a second area of the three-dimensional virtualenvironment from the perspective of the light source in thethree-dimensional virtual environment. The second shadow map specifies aplurality of second distances from the light source to objects of thethree-dimensional virtual environment. The second resolution is lessthan the first resolution and the second area is larger than the firstarea. Further, the method continues by rendering an image of thethree-dimensional virtual environment from the perspective of thevirtual camera. The method then performs several operations forrespective pixels of the image. First, the method begins by determininga third distance of a position depicted in the respective pixel to thelight source. When the respective pixel depicts the first area, themethod selects, from the first shadow map, which first distancecorresponds to the respective pixel. When the respective pixel depictsthe second area, the method selects, from the second shadow map, whichsecond distance corresponds to the respective pixel. When the thirddistance exceeds the selected first or second distance, the methodshades the respective pixel. The method then determines a fourthdistance in the three-dimensional virtual environment between a currentlocation of the virtual camera and where the virtual camera was when thefirst shadow map was rendered. When the fourth distance exceeds athreshold, the method also moves the first area to be in proximity ofthe virtual camera at the current location. The method concludes byre-rendering, at the first resolution, the first shadow map of the firstarea of the three-dimensional virtual environment from the perspectiveof the light source in the three-dimensional virtual environment.

System, device, and computer program product embodiments are alsodisclosed.

Further embodiments, features, and advantages of the invention, as wellas the structure and operation of the various embodiments, are describedin detail below with reference to accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings, which are incorporated herein and form partof the specification, illustrate the present disclosure and, togetherwith the description, further serve to explain the principles of thedisclosure and to enable a person skilled in the relevant art to makeand use the disclosure.

FIG. 1 is a diagram illustrating an example interface that providesvideoconferencing in a virtual environment with video streams beingmapped onto avatars.

FIG. 2 is a diagram illustrating a three-dimensional model used torender a virtual environment with avatars for videoconferencing.

FIG. 3 is a diagram illustrating a system that provides videoconferencesin a virtual environment.

FIGS. 4A-C illustrate how data is transferred between various componentsof the system in FIG. 3 to provide videoconferencing.

FIGS. 5A-B are flowcharts illustrating a method for initiating avideoconference application in a virtual environment and beginning arendering loop.

FIG. 6 is a diagram illustrating a data structure for representingenvironment entities.

FIG. 7 is a screenshot illustrating a user interface for selecting aproperty to adjust graphics quality.

FIG. 8 is a flowchart illustrating a method for processing materials andoptimizing a mesh according to an embodiment.

FIG. 9 is a flowchart illustrating a rendering loop for a virtualreality conferencing application.

FIG. 10 is a flowchart illustrating a method for optimizing physicssimulation in the virtual environment.

FIGS. 11A-B are diagrams providing an example optimization of thephysics simulation in FIG. 10 .

FIG. 12 is a flowchart illustrating a method rendering a fixedbackground image and accompanying occlusion map.

FIG. 13 is a diagram illustrating an example environment where a virtualcamera captures a background image and occlusion map.

FIG. 14 illustrates an example background image.

FIG. 15 is a flowchart illustrating a method for rendering dynamicobjects and stitching together the dynamic objects with the backgroundimage using the inclusion.

FIG. 16 illustrates an example image of dynamic objects.

FIG. 17 illustrates an example image stitching together the dynamicobjects with the background image using the occlusion map.

FIG. 18 is a flowchart illustrating a method for rendering shadow mapsat different resolutions.

FIGS. 19A-B are diagrams illustrating examples of rendering shadow mapsdifferent resolutions.

FIGS. 20A-C illustrate an example of sampling shadow maps at an offset.

FIG. 21 illustrates an example of fading between shadows generated fromshadow maps of different resolutions.

FIGS. 22 and 23 illustrate an example of how shadow maps are used toshade a scene.

FIGS. 24A-C illustrate generating a volumetric scattering effect.

FIG. 25 illustrates components of the conference application running ona client device.

FIG. 26 illustrates a system diagram of the client and server device ina video conference application in a virtual environment.

The drawing in which an element first appears is typically indicated bythe leftmost digit or digits in the corresponding reference number. Inthe drawings, like reference numbers may indicate identical orfunctionally similar elements.

DETAILED DESCRIPTION

Video Conference with Avatars in a Virtual Environment

FIG. 1 is a diagram illustrating an example of an interface 100 thatprovides videoconferences in a virtual environment with video streamsbeing mapped onto avatars.

Interface 100 may be displayed to a participant to a videoconference.For example, interface 100 may be rendered for display to theparticipant and may be constantly updated as the videoconferenceprogresses. A user may control the orientation of their virtual camerausing, for example, keyboard inputs. In this way, the user can navigatearound a virtual environment. In an embodiment, different inputs maychange the virtual camera's X and Y position and pan and tilt angles inthe virtual environment. In further embodiments, a user may use inputsto alter height (the Z coordinate) and yaw of the virtual camera. Instill further embodiments, a user may enter inputs to cause the virtualcamera to “hop” up while returning to its original position, simulatinggravity. The inputs available to navigate the virtual camera mayinclude, for example, keyboard and mouse inputs, such as WASD keyboardkeys to move the virtual camera forward, backward, left, or right on anX-Y plane, a space bar key to “hop” the virtual camera, and mousemovements specifying details on changes in pan and tilt angles. Inaddition, the virtual camera may be navigated with a joystick interface106. The joystick interface 106 may be particularly advantageous on atouchscreen display where WASD keyboard control is unavailable. Detailson how the environment is updated, both in response to inputs from theuser and updates in the virtual environment, are discussed below withrespect to FIG. 1 .

Interface 100 includes avatars 102A and B, which each representdifferent participants to the videoconference. Avatars 102A and B,respectively, are representations of participants to thevideoconference. The representation may be a two-dimensional orthree-dimensional model. The two- or three-dimensional model may havetexture mapped video streams 104A and B from devices of the first andsecond participant. A texture map is an image applied (mapped) to thesurface of a shape or polygon. Here, the images are respective frames ofthe video. The camera devices capturing video streams 104A and B arepositioned to capture faces of the respective participants. In this way,the avatars have texture mapped thereon, moving images of faces asparticipants in the meeting talk and listen.

Similar to how the virtual camera is controlled by the user viewinginterface 100, the location and direction of avatars 102A and B arecontrolled by the respective participants that they represent. Avatars102A and B are three-dimensional models represented by a mesh. Eachavatar 102A and B may have the participant's name underneath the avatar.

The respective avatars 102A and B are controlled by the various users.They each may be positioned at a point corresponding to where their ownvirtual cameras are located within the virtual environment. Just as theuser viewing interface 100 can move around the virtual camera, thevarious users can move around their respective avatars 102A and B.

The virtual environment rendered in interface 100 includes backgroundimage 120 and a three-dimensional model 118 of an arena. The arena maybe a venue or building in which the videoconference should take place.The arena may include a floor area bounded by walls. Three-dimensionalmodel 118 can include a mesh and texture. Other ways to mathematicallyrepresent the surface of three-dimensional model 118 may be possible aswell. For example, polygon modeling, curve modeling, and digitalsculpting may be possible. For example, three-dimensional model 118 maybe represented by voxels, splines, geometric primitives, polygons, orany other possible representation in three-dimensional space.Three-dimensional model 118 may also include specification of lightsources. The light sources can include for example, point, directional,spotlight, and ambient. The objects may also have certain propertiesdescribing how they reflect light. In examples, the properties mayinclude diffuse, ambient, and spectral lighting interactions. Thesematerial properties are discussed in greater detail, for example, withrespect to FIG. 5B. The light sources may also interact with objects inthe scene to cast shadows. Examples of how shadows are cast aredescribed, for example, with respect to FIGS. 18, 19A-B, and 20A-B.

In addition to the arena, the virtual environment can include variousother three-dimensional models that illustrate different components ofthe environment. For example, the three-dimensional environment caninclude a decorative model 114, a speaker model 116, and a presentationscreen model 122. Just as three-dimensional model model 118, thesemodels can be represented using any mathematical way to represent ageometric surface in three-dimensional space. These models may beseparate from three-dimensional model model 118 or combined into asingle representation of the virtual environment.

Decorative models, such as decorative model 114, serve to enhance therealism and increase the aesthetic appeal of the arena. Speaker model116 may virtually emit sound, such as presentation and background music.Presentation screen model 122 can serve to provide an outlet to presenta presentation. Video of the presenter or a presentation screen sharemay be texture mapped onto presentation screen model 122.

Button 108 may provide a way to change the settings of the conferenceapplication. For example, button 108 may include a property to graphicsquality as described below with respect to FIG. 7 .

Button 110 may enable a user to change attributes of the virtual cameraused to render interface 100. For example, the virtual camera may have afield of view specifying the angle at which the data is rendered fordisplay. Modeling data within the camera field of view is rendered,while modeling data outside the camera's field of view may not be. Bydefault, the virtual camera's field of view may be set somewhere between60 and 110°, which is commensurate with a wide-angle lens and humanvision. However, selecting button 110 may cause the virtual camera toincrease the field of view to exceed 170°, commensurate with a fisheyelens. This may enable a user to have broader peripheral awareness of itssurroundings in the virtual environment.

Finally, button 112 causes the user to exit the virtual environment.Selecting button 112 may cause a notification to be sent to devicesbelonging to the other participants signaling to their devices to stopdisplaying the avatar corresponding to the user previously viewinginterface 100.

In this way, interface virtual 3D space is used to conductvideoconferencing. Every user controls an avatar, which they can controlto move around, look around, jump or do other things which change theposition or orientation. A virtual camera shows the user the virtual 3Denvironment and the other avatars. The avatars of the other users haveas an integral part a virtual display, which shows the webcam image ofthe user.

By giving users a sense of space and allowing users to see each other'sfaces, embodiments provide a more social experience than conventionalweb conferencing or conventional MMO gaming. That more social experiencehas a variety of applications. For example, it can be used in onlineshopping. For example, interface 100 has applications in providingvirtual grocery stores, houses of worship, trade shows, B2B sales, B2Csales, schooling, restaurants or lunchrooms, product releases,construction site visits (e.g., for architects, engineers, contractors),office spaces (e.g., allowing people work “at their desks” virtually),remote control of machines (e.g. ships, vehicles, planes, submarines,drones, drilling equipment, etc.), plant/factory control rooms, medicalprocedures, garden designs, virtual bus tours with guide, music events(e.g., concerts), lectures (e.g., TED talks), meetings of politicalparties, board meetings, means to perform underwater research, researchon hard to reach places, training for emergencies (e.g., fire), cooking,shopping (with checkout and delivery), virtual arts and crafts (e.g.,painting and pottery), marriages, funerals, baptisms, remote sportstraining, counseling, treating fears (e.g., confrontation therapy),fashion shows, amusement parks, home decoration, watching sports,watching esports, watching performances captured using athree-dimensional camera, playing board and role playing games, walkingover/through medical imagery, viewing geological data, learninglanguages, meeting in a space for the visually impaired, meeting in aspace for the hearing impaired, participation in events by people whonormally can't walk or stand up, presenting the news or weather, talkshows, book signings, voting, MMOs, buying/selling virtual locations(such as those available in some MMOs like the SECOND LIFE gameavailable from Linden Research, Inc. of San Francisco, Calif.), fleamarkets, garage sales, travel agencies, banks, archives, computerprocess management, fencing/sword fighting/martial arts, reenactments(e.g., reenacting a crime scene and or accident), rehearsing a realevent (e.g., a wedding, presentation, show, space-walk), evaluating orviewing a real event captured with three-dimensional cameras, livestockshows, zoos, experiencing life as a tall/short/blind/deaf/white/blackperson (e.g., a modified video stream or still image for the virtualworld to simulate the perspective that a user wishes to experience thereactions), job interviews, game shows, interactive fiction (e.g.,murder mystery), virtual fishing, virtual sailing, psychologicalresearch, behavioral analysis, virtual sports (e.g.,climbing/bouldering), controlling the lights, etc., in your house orother location (domotics), memory palace, archaeology, gift shop,virtual visit so customers will be more comfortable on their real visit,virtual medical procedures to explain the procedures and have peoplefeel more comfortable, virtual trading floor/financial marketplace/stockmarket (e.g., integrating real-time data and video feeds into thevirtual world, real-time transactions and analytics), virtual locationpeople have to go as part of their work so they will actually meet eachother organically (e.g., if you want to create an invoice, it is onlypossible from within the virtual location), augmented reality where youproject the face of the person on top of their AR headset (or helmet) soyou can see their facial expressions (e.g., useful for military, lawenforcement, firefighters, special ops), and making reservations (e.g.,for a certain holiday home/car/etc.).

FIG. 2 is a diagram 200 illustrating a three-dimensional model used torender a virtual environment with avatars for videoconferencing. Just asillustrated in FIG. 1 , the virtual environment here includes athree-dimensional arena 118, and various three-dimensional models,including three-dimensional models 114A-B and 122. Three-dimensionalmodels 114A-B represent foliage, and three-dimensional model 122represents a presentation screen. Three-dimensional models 114A-B and122 are static in that they have a fixed position within the threedimensional model. Also as illustrated in FIG. 1 , diagram 200 includesavatars 102A and B. Avatars 102A and B are dynamic in that they are freeto navigating around the virtual environment.

As described above, interface 100 in FIG. 1 is rendered from theperspective of a virtual camera. That virtual camera is illustrated indiagram 200 as virtual camera 204. As mentioned above, the user viewinginterface 100 in FIG. 1 can control virtual camera 204 and navigate thevirtual camera in three-dimensional space. Interface 100 is constantlybeing updated according to the new position of virtual camera 204 andany changes of the models within in the field of view of virtual camera204. As described above, the field of view of virtual camera 204 may bea frustum defined, at least in part, by horizontal and vertical field ofview angles.

As described above with respect to FIG. 1 , a background image ortexture may define at least part of the virtual environment. Thebackground image may capture aspects of the virtual environment that aremeant to appear at a distance. The background image may be texturemapped onto a sphere 202. The virtual camera 204 may be at an origin ofthe sphere 202. In this way, distant features of the virtual environmentmay be efficiently rendered.

In other embodiments, other shapes instead of sphere 202 may be used totexture map the background image. In various alternative embodiments,the shape may be a cylinder, cube, rectangular prism, or any otherthree-dimensional geometry.

FIG. 3 is a diagram illustrating a system 300 that providesvideoconferences in a virtual environment. System 300 includes a server302 coupled to devices 306A and B via one or more networks 304.

Server 302 provides the services to connect a videoconference sessionbetween devices 306A and 306B. As will be described in greater detailbelow, server 302 communicates notifications to devices of conferenceparticipants (e.g., devices 306A-B) when new participants join theconference and when existing participants leave the conference. Server302 communicates messages describing a position and direction in athree-dimensional virtual space for respective participant's virtualcameras within the three-dimensional virtual space. Server 302 alsocommunicates video and audio streams between the respective devices ofthe participants (e.g., devices 306A-B). Finally, server 302 stores andtransmits data describing data specifying a three-dimensional virtualspace to the respective devices 306A-B.

In addition to the data necessary for the virtual conference, server 302may provide executable information that instructs the devices 306A and306B on how to render the data to provide the interactive conference.

Server 302 responds to requests with a response. Server 302 may be a webserver. A web server is software and hardware that uses HTTP (HypertextTransfer Protocol) and other protocols to respond to client requestsmade over the World Wide Web. The main job of a web server is to displaywebsite content through storing, processing and delivering webpages tousers.

In an alternative embodiment, communication between devices 306A-Bhappens not through server 302 but on a peer-to-peer basis. In thatembodiment, one or more of the data describing the respectiveparticipants' location and direction, the notifications regarding newand exiting participants, and the video and audio streams of therespective participants are communicated not through server 302 butdirectly between devices 306A-B.

Network 304 enables communication between the various devices 306A-B andserver 302. Network 304 may be an ad hoc network, an intranet, anextranet, a virtual private network (VPN), a local area network (LAN), awireless LAN (WLAN), a wide area network (WAN), a wireless wide areanetwork (WWAN), a metropolitan area network (MAN), a portion of theInternet, a portion of the Public Switched Telephone Network (PSTN), acellular telephone network, a wireless network, a WiFi network, a WiMaxnetwork, any other type of network, or any combination of two or moresuch networks.

Devices 306A-B are each devices of respective participants to thevirtual conference. Devices 306A-B each receive data necessary toconduct the virtual conference and render the data necessary to providethe virtual conference. As will be described in greater detail below,devices 306A-B include a display to present the rendered conferenceinformation, inputs that allow the user to control the virtual camera, aspeaker (such as a headset) to provide audio to the user for theconference, a microphone to capture a user's voice input, and a camerapositioned to capture video of the user's face.

Devices 306A-B can be any type of computing device, including a laptop,a desktop, a smartphone, a tablet computer, or a wearable computer (suchas a smartwatch or a augmented reality or virtual reality headset).

Web browser 308A-B can retrieve a network resource (such as a webpage)addressed by the link identifier (such as a uniform resource locator, orURL) and present the network resource for display. In particular, webbrowser 308A-B is a software application for accessing information onthe World Wide Web. Usually, web browser 308A-B makes this request usingthe hypertext transfer protocol (HTTP or HTTPS). When a user requests aweb page from a particular website, the web browser retrieves thenecessary content from a web server, interprets and executes thecontent, and then displays the page on a display on device 306A-B shownas client/counterpart conference application 308A-B. In examples, thecontent may have HTML and client-side scripting, such as JavaScript.Once displayed, a user can input information and make selections on thepage, which can cause web browser 308A-B to make further requests.

Conference application 310A-B may be a web application downloaded fromserver 302 and configured to be executed by the respective web browsers308A-B. In an embodiment, conference application 310A-B may be aJavaScript application. In one example, conference application 310A-Bmay be written in a higher-level language, such as a Typescriptlanguage, and translated or compiled into JavaScript. Conferenceapplication 310A-B is configured to interact with the WebGL JavaScriptapplication programming interface. It may have control code specified inJavaScript and shader code written in OpenGL ES Shading Language (GLSLES). Using the WebGL API, conference application 310A-B may be able toutilize a graphics processing unit (not shown) of device 306A-B.Moreover, OpenGL rendering of interactive two-dimensional andthree-dimensional graphics without the use of plug-ins.

Conference application 310A-B receives the data from server 302describing position and direction of other avatars and three-dimensionalmodeling information describing the virtual environment. In addition,conference application 310A-B receives video and audio streams of otherconference participants from server 302.

Conference application 310A-B renders three-dimensional modeling data,including data describing the three-dimensional virtual environment anddata representing the respective participant avatars. This rendering mayinvolve rasterization, texture mapping, ray tracing, shading, or otherrendering techniques. The rendering process will be described in greaterdetail with effect to, for example, FIG. 9 . In an embodiment, therendering may involve ray tracing based on the characteristics of thevirtual camera. Ray tracing involves generating an image by tracing apath of light as pixels in an image plane and simulating the effects ofhis encounters with virtual objects. In some embodiments, to enhancerealism, the ray tracing may simulate optical effects such asreflection, refraction, scattering, and dispersion.

In this way, the user uses web browser 308A-B to enter a virtual space.The scene is displayed on the screen of the user. The webcam videostream and microphone audio stream of the user are sent to server 302.When other users enter the virtual space an avatar model is created forthem. The position of this avatar is sent to the server and received bythe other users. Other users also get a notification from server 302that an audio/video stream is available. The video stream of a user isplaced on the avatar that was created for that user. The audio stream isplayed back as coming from the position of the avatar.

FIGS. 4A-C illustrate how data is transferred between various componentsof the system in FIG. 3 to provide videoconferencing. Like FIG. 3 , eachof FIGS. 4A-C depict the connection between server 302 and devices 306Aand B. In particular, FIGS. 4A-C illustrate example data flows betweenthose devices.

FIG. 4A illustrates a diagram 400 illustrating how server 302 transmitsdata describing the virtual environment to devices 306A and 306B. Inparticular, both devices 306A and 306B, receive from server 302environment entities 402A and 402B respectively. Environment entities402A-B represent a data structure describing the virtual environments todevices 306A-B. In an example, Environment entities 402A-B may describethe virtual environments in HTML using a VR framework, such as theA-Frame VR framework. A-Frame is an open-source web framework forbuilding virtual reality (VR) experiences. A-Frame is an entitycomponent system framework for a JavaScript rendering engine wheredevelopers can create 3D and WebVR scenes using HTML.

For example, the HTML file may reference the A-frame framework in ascript element of the HTML file, and in the body element, the HTML filemay reference individual entities within the VR environment. An entityrepresents a general-purpose object. In a game engine context, forexample, every coarse game object is represented as an entity. Goingback to the example in FIG. 2 , each of arena 118, foliage 114A-B,presentation screen 122, avatars 102A-B, background image 202 and evenvirtual camera 204 may be one or more entities. Each entity may havecomponents describing attributes of the entity. Components label anentity as possessing a particular aspect, and holds the data needed tomodel that aspect. More details regarding enter environment entities402A-B are provided with respect to FIG. 6 .

With the information needed to conduct the meeting sent to theparticipants, FIGS. 4B-C illustrate how server 302 forwards informationfrom one device to another. FIG. 4B illustrates a diagram 440 showinghow server 302 receives information from respective devices 306A and B,and FIG. 4C illustrates a diagram 460 showing how server 302 transmitsthe information to respective devices 306B and A. In particular, device306A transmits position and direction 422A, video stream 424A, and audiostream 426A to server 302, which transmits position and direction 422A,video stream 424A, and audio stream 426A to device 306B. And device 306Btransmits position and direction 422B, video stream 424B, and audiostream 426B to server 302, which transmits position and direction 422B,video stream 424B, and audio stream 426B to device 306A.

Position and direction 422A-B describe the position and direction of thevirtual camera for the user using device 306A-B respectively. Asdescribed above, the position may be a coordinate in three-dimensionalspace (e.g., x, y, z coordinate) and the direction may be a direction inthree-dimensional space (e.g., pan, tilt, roll). In some embodiments,the user may be unable to control the virtual camera's roll, so thedirection may only specify pan and tilt angles. Similarly, in someembodiments, the user may be unable to change the avatar's Z coordinate(as the avatar is bounded by virtual gravity), so the Z coordinate maybe unnecessary. In this way, position and direction 422A-B each mayinclude at least a coordinate on a horizontal plane in thethree-dimensional virtual space and a pan and tilt value. Alternativelyor additionally, the user may be able to “jump” its avatar, so the Zposition may be specified only by an indication of whether the user isjumping their avatar.

In different examples, position and direction 422A-B may be transmittedand received using HTTP request responses or using socket messaging.

Video stream 424A-B is video data captured from a camera of therespective devices 306A and B. The video may be compressed. For example,the video may use any commonly known video codecs, including MPEG-4,VP8, or H.264. The video may be captured and transmitted in real time.

Similarly, audio stream 426A-B is audio data captured from a microphoneof the respective devices. The audio may be compressed. For example, thevideo may use any commonly known audio codecs, including MPEG-4 orvorbis. The audio may be captured and transmitted in real time. Videostream 424A and audio stream 426A are captured, transmitted, andpresented synchronously with one another. Similarly, video stream 424Band audio stream 426B are captured, transmitted, and presentedsynchronously with one another.

The video stream 424A-B and audio stream 426A-B may be transmitted usingthe WebRTC application programming interface. The WebRTC is an APIavailable in JavaScript. As described above, devices 306A and B downloadand run web applications, as conference applications 310A and B, andconference applications 310A and B may be implemented in JavaScript.Conference applications 310A and B may use WebRTC to receive andtransmit video stream 424A-B and audio stream 426A-B by making API callsfrom its JavaScript.

As mentioned above, when a user leaves the virtual conference, thisdeparture is communicated to all other users. For example, if device306A exits the virtual conference, server 302 would communicate thatdeparture to device 306B. Consequently, device 306B would stop renderingan avatar corresponding to device 306A, removing the avatar from thevirtual space. Additionally, device 306B will stop receiving videostream 424A and audio stream 426A.

While FIG. 3 and FIGS. 4A-C are illustrated with two devices forsimplicity, a skilled artisan would understand that the techniquesdescribed herein can be extended to any number of devices. Also, whileFIG. 3 and FIGS. 4A-C illustrate a single server 302, a skilled artisanwould understand that the functionality of server 302 can be spread outamong a plurality of computing devices. In an embodiment, the datatransferred in FIG. 4A may come from one network address for server 302,while the data transferred in FIGS. 4B-C can be transferred to/fromanother network address for server 302.

Initiating the Conference Application

FIGS. 5A-B are flowcharts illustrating a method for initiating avideoconference application in a virtual environment and beginning arendering loop.

At step 502, device 306A requests a world space from server 302. In oneembodiment, a user may first login by entering credentials on a loginpage. After submitting the credentials and authenticating the user, theserver may return a page that lists available worlds that the user isauthorized to enter. For example, there may be different workspaces ordifferent floors within a workspace. In one embodiment, participants canset their webcam, microphone, speakers and graphical settings beforeentering the virtual conference.

At 504, server 302 returns the conference application to device 306A. Inan embodiment, once the user selects a world to enter, server 302 willreturn a conference application to device 306A for execution. Asdescribed above, the conference application may be a softwareapplication configured to run within a web browser. For example, theconference application may be a JavaScript application. The conferenceapplication may include the instructions needed for the web browserwithin device 306A to execute the virtual conference application. Moredetail on the conference applications provided below for example withrespect to FIG. 25 .

At 506, device 306A starts executing the conference application. Asmentioned above, the conference application may be a JavaScriptapplication. To execute the JavaScript application, device 306 a may usea JavaScript engine within its web browser to execute the conferenceapplication. An example of such a JavaScript engine is the V8 JavaScriptengine available from Alphabet Inc. of Mountain View, Calif.

At 508, device 306A requests information specifying thethree-dimensional space from server 302. This may involve makingHTTP/HTTPS requests to server 302.

At 510, server 302 returns environment entities to device 306A. Asmentioned above, the environment entities specifying thethree-dimensional space may, for example, include an A-frame HTML file.In example is described in greater detail with respect to FIG. 6 .

FIG. 6 is a diagram illustrating a data structure 402 for representingenvironment entities. Data structure 402 may follow anEntity-Component-System (ECS) architectural pattern. ECS follows thecomposition over the inheritance principle, which offers betterflexibility and helps identify entities where each object in athree-dimensional scene are considered an entity. The entities may bestructured as a tree with each entity inheriting properties of theentity above it.

A component is a singular behavior ascribed to an entity. A compositionis an element that could be attached more components to add additionalappearance, behavior, or functionality. You can also update thecomponent values to configure the entity. The name of an element shouldideally communicate what behavior the entity will exhibit. A system williterate many components to perform low-level functions such as renderinggraphics, performing physics calculations or pathfinding. It offersglobal scope, management, and services for classes of components.Examples of the system include gravity, adding velocity to position, andanimations.

Data structure 402 includes model references 602, sound references 608,animation references 610, zone 612, video sources 614, and presentationscreen share 616.

Model references 602 each specify a model in three-dimensional space.Turning to the example provided in FIG. 2 , the depicted virtualenvironment includes three-dimensional arena 118; variousthree-dimensional models, including three-dimensional models 114A-B offoliage and three-dimensional model 122 of a presentation screen; andthree-dimensional models 102A-B of avatars. Model references 602 mayspecify each of these. Each of model references 602 may include at leastone texture reference 604 and shape reference 606.

As described above, background texture 120 is an image illustratingdistant features of the virtual environment. The image may be regular(such as a brick wall) or irregular. Background texture 402 may beencoded in any common image file format, such as bitmap, JPEG, GIF, orother file image format. It describes the background image to berendered against, for example, a sphere at a distance.

Three-dimensional arena 118 is a three-dimensional model of the space inwhich the conference is to take place. As described above, it mayinclude, for example, a mesh and possibly its own texture information tobe mapped upon the three-dimensional primitives it describes. It maydefine the space in which the virtual camera and respective avatars cannavigate within the virtual environment. Accordingly, it may be boundedby edges (such as walls or fences) that illustrate to users theperimeter of the navigable virtual environment.

Three-dimensional model 602 is any other three-dimensional modelinginformation needed to conduct the conference. In one embodiment, thismay include information describing the respective avatars. Alternativelyor additionally, this information may include product demonstrations.

Texture references 604 references a graphical image that is used totexture map onto a three dimensional model. Each of texture references604 may include a uniform resource locator (URL) that indicates where toretrieve the associated texture. The graphical image may be applied(mapped) to the surface of a shape. It may be stored in common imagefile formats and may be stored in swizzle or tiled orderings to improvememory utilization. They may have RGB color data and they also may havealpha blending. Alpha blending adds an additional channel to specifytransparency. This may be particularly useful when a three-dimensionalarticle is represented by two-dimensional shapes. For example, foliage,such as the foliage 114A and 114B, may be defined using alpha modeling,with the shape of each leaf being defined using the alpha channel.

As will be described below in greater detail with respect to FIG. 7 ,each image may be specified by multiple texture references 604, witheach texture reference 604 referencing an image at a differentresolution. In this way, embodiments can select a texture resolution touse enabling the environment to be adapted to execute on computingdevices of different operating powers. Texture references 604 may alsoinclude references to materials. Materials define the optical propertiesof an object for example, how it's color, dullness, or shininess areaffected.

Shape references 606 defined three-dimensional shapes. Each of shapereferences 606 may include a uniform resource locator (URL) thatindicates where to retrieve the associated three-dimensional shape. Forexample, the three-dimensional shape may represent three-dimensionalmeshes, voxels or any other techniques.

Animation references 610 may reference animations to play within thethree-dimensional environment. The animation may describe motion overtime.

Zones 612 represent areas within the three-dimensional environment. Theareas can be used for example to ensure sound privacy. Zones 612 aredata specifying partitions in the virtual environment. These partitionsare used to determine how sound is processed before being transferredbetween participants. As will be described below, this partition datamay be hierarchical and may describe sound processing to allow for areaswhere participants to the virtual conference can have privateconversations or side conversations.

Video sources 614 represent sources of video to present within threedimensional environment. For example, as described above, each avatarmay have a corresponding video that is captured of the user controllingthe avatar. That video may be transmitted using WebRTC or other knowntechniques. Video sources 614 describe connection information for thevideo (including the associated audio).

Presentation screen share 616 describe sources of screen share streamsto present within a three dimensional environment. As described above,users can share their screens within the three-dimensional environmentand the streaming screen shares can be texture mapped onto models withinthe three dimensional environment.

Returning to FIG. 5 , once server 302 returns environment entities todevice 306A at 510, device 306A requests textures selected based on aproperty from server 302 at 512. For each texture in the virtualenvironment, server 302 may include multiple versions representing thesame image at different resolutions. When a texture is uploaded to arepository on server 302, images for the texture are precomputed andstored at the repository. In particular, whenever an image is receivedto use as a texture for a three-dimensional model, the image isconverted to at least one lower quality. The lower qualities may be12.5%, 25%, and 50% of the original or maximum 100% resolution. Inalternative or additional embodiments, different quality models orsounds may be selected based on property.

As mentioned above, the environment entities downloaded may havemultiple references to the same texture, but at different resolutions.The user may have a setting to select which resolution textures torequest. Alternatively or additionally, the resolution requested maydepend on a distance from the virtual camera. Lower quality textures maybe loaded for objects that are more distant in higher quality texturesmay be loaded for objects that are closer to the virtual camera.

FIG. 7 is a screenshot illustrating a user interface 700 for selecting aproperty to adjust graphics quality. As shown in FIG. 7 , user interfaceuser interface 700 includes a menu 702 with different quality levels toselect. This sets a property on the client device that the conferenceapplication uses to determine which quality texture to request.

In an embodiment, the property setting is lower when the request is sendfrom a device with a smaller screen. In this embodiment, the conferenceapplication can determine a screen size of the device and select aquality property to request a texture resolution based on the screensize of device 306A. Additionally or alternatively, the property settingis lower when the request is send from a device with lower processingpower. In this embodiment, the conference application can determine anavailable processing power of the device and select a quality propertyto request a texture resolution based on the screen size of device 306A.

In this way, at 512, device 306A requests a texture selected based on aproperty of the conference application. The request indicates a level ofresolution requested, wherein the property setting selects one ofseveral possible levels of resolution.

In an embodiment, the downgraded image is rendered with differentmaterials based on the property setting. With a lower quality setting,the downgraded image may be rendered with a simplified material thatrequires less processing power to render. For example the simplifiedmaterial may lack physically-based rendering (e.g., metalness) andrequire fewer calculations for rendering the material properties. Forexample, the simplified material may exhibit Lambertian reflectance. Ifa higher quality is selected, the physically-based rendering may beselected instead.

At 514, server 302 returns selected textures to device 306A. When thehighest quality setting is not used, server 302 receives, from a clientdevice, a request for the downgraded image. In response to the requestfor the image, server 302 sends the image to the client to texture maponto the three dimensional model for presentation within athree-dimensional environment.

At 516, device 306A requests information about other users. Inparticular, device 306A requests audio and video streams of other users.

At 518, server 302 returns audio and video connections for the otherusers.

At 520, device 306A waits for all files to load. During this period, allthe requested files describing the three-dimensional environment areloaded from server 302. While the files are being noted a loading screenmay be presented to a user.

Once all the files are load, device 306 conducts certain optimizationson the environment entities to enable them to be rendered moreefficiently. Device 306A processes materials at 522 and optimizes meshesat 524. Steps 522 and 524 are described in greater detail with respectto FIG. 8 .

At 526, device 306A disables mipmapping for textures that use alphatesting. In computer graphics, mipmaps (also MIP maps) or pyramids arepre-calculated, optimized sequences of images, each of which is aprogressively lower resolution representation of the previous. Theheight and width of each image, or level, in the mipmap is a factor oftwo smaller than the previous level. They are intended to increaserendering speed and reduce aliasing artifacts. Mipmapping is a moreefficient way of downfiltering (minifying) a texture; rather thansampling all texels in the original texture that would contribute to ascreen pixel, it is faster to take a constant number of samples from theappropriately downfiltered textures. By default, the conferenceapplication may enable mipmapping for textures on models in thethree-dimensional environment.

As mentioned above, some textures have an alpha channel. In fact, somemodels in the three-dimensional environment may only have two dimensionsand be defined entirely by the alpha channel of the texture. This isparticular useful for models of foliage, but may also be used for modelsof things like fences. For these alpha map models, their shape on atwo-dimensional plane in the three-dimensional environment is defined bya texture that indicates whether each position on the two-dimensionalplane is transparent and opaque. For example, each pixel may be a one orzero depending on whether that pixel is transparent or opaque.

Because the shape of the alpha map models are specified by the texture,mipmapping these textures results in a changing shape. However, thischanging shape could lead to problematic artifacts when calculatingshadows. In an example, as the graphics card generates a lowerresolution texture, leaves disappear. However, as will be discussed ingreater detail below with respect to shadow generation, the shadow mayremain. At least in part to deal this issue, according to an embodiment,mipmapping is disabled for alpha map models at 526.

At 528, device 306A disables the loading screen.

At 530, device 306A enters a render loop. The render loop will bedescribed in greater detail with respect to FIG. 9 . As described above,the conference application may periodically or intermittently re-renderthe virtual space based on new information from respective videostreams, position and direction of the virtual camera or avatars, andnew information relating to the three-dimensional environment.

As device 306A receives the video stream, the device texture maps framesfrom video stream on to an avatar corresponding to device 306A. Thattexture mapped avatar is re-rendered within the three-dimensionalvirtual space and presented to a user of device 306A.

As device 306A receives a new position and direction information fromother devices, device 306A generates the avatar corresponding to device306B positioned at the new position and oriented at the new direction.The generated avatar is re-rendered within the three-dimensional virtualspace and presented to the user of device 306A.

When another user exits the virtual conference, server 302 sends anotification to device 306A indicating that the other user is no longerparticipating in the conference. In that case, device 306A wouldre-render the virtual environment without the avatar for the other user.

In some embodiments, server 302 may send updated model informationdescribing the three-dimensional virtual environment. When that happens,device 306A will re-render the virtual environment based on the updatedinformation. This may be useful when the environment changes over time.For example, an outdoor event may change from daylight to dusk as theevent progresses.

Entity and Scene Graph Optimizations

FIG. 8 is a flowchart illustrating a method 800 for processing materialsand optimizing a mesh according to an embodiment. As mentioned above,the data structure representing the 3D three-dimensional virtualenvironment that the client 306A receives from server 302 may berepresented in a VR language. In an embodiment, the data structure maybe represented in an ECS language. In one example, the data structuremay be represented in A-frame.

Before passing to the rendering engine, the VR framework data structurereceived from server 302 may need to be converted into a scene graphthat is can be processed by the rendering engine. A scene graph is ageneral data structure commonly used by vector-based graphics editingapplications and modern computer games, which arranges the logical andoften spatial representation of a graphical scene. It is a collection ofnodes in a graph or tree structure. A scene may be is a hierarchy ofnodes in a graph where each node represents a local space. An operationperformed on a parent node automatically propagates its effect to all ofits children, its children's children, and so on. Each leaf node in ascene graph may represents some atomic unit of the document, usually ashape such as an ellipse or Bezier path.

Method 800 may include optimizations that occur when converting the VRframework file, such as an A-frame file, into a scene graph.

At 802, conference application 310 deduplicates textures. Conferenceapplication 310 may identify those textures in the environment entities402 that are identical to one another. To identify they are identical toone another, conference application 310 may determine that the imagesare the same and properties associated with the image are also the same.Properties include, for example, whether mipmapping is enabled and anyvalues indicating whether the texture is repeated, rotated, or offset,indicating how the texture can be sampled, etc. When two or moretextures are identified as identical in the VR framework, only a singlenode representing the texture may be used in the scene graph.

At 804, conference application 310 deduplicates materials in a similarmanner to its de-duplication of materials. Conference application 310may identify those materials in the environment entities 402 that areidentical to one another. To identify they are identical to one another,conference application 310 may determine that they specify the sameoperations to perform when exposed to light. For example, somematerials, like a piece of chalk, are dull and disperse reflected lightabout equally in all directions; others, like a mirror, reflect lightonly in certain directions relative to the viewer in light source. Othermaterials have some degree of transparency, allowing some amount oflight to pass through. When two or more materials are identified asidentical in the VR framework, only a single node representing thetexture may be used in the scene graph.

Alternatively or additionally, textures or materials may be merged whenwe determine they are ‘close enough.’ For example, if two textures ormaterials are similar enough (which can be determined using, forexample, computer vision techniques), either only one is used or a newextra material that is in-between the two is determined. The newmaterial may be determined by, for example, averaging the propertiesthat are different or through use of an algorithm to find a new variantthat will work for all uses. Subsequently, this merged texture materialis deduplicated.

In addition to or alternatively from textures and materials, in variousembodiments, shapes may deduplicated as well. Identical shapes may bedetermined and de-duplicated. As described above, in situations whereshapes are similar, shapes may be merged into a new average shape, andthat new average shape may be de-duplicated. Alternatively oradditionally two or more dissimilar meshes that have the same materialmay be merged into a single new mesh having that material. This may bedone by calculating the relative positions of the vertices of thedifferent meshes and appending those into a new list of vertices. Thelists of triangles may be combined by using degenerate triangles inorder to prevent a visible connection between the different meshes.

At 806, conference application 310 generates freeze matrices. Asdescribed above, the scene graph be structured as a tree of individualnodes. A parent node has children and those child nodes may have theirown children. A node that has no children is a leaf node; the leaf nodemay represent an atomic object within the rendering and engine. Leaf andnon-leaf nodes may represent a shape or geometric primitive. In anexample, a node may have a chair node as its child. The child node mayhave legs, a seat and a back, each as child nodes.

An example is illustrated in FIG. 11A. FIG. 11A illustrates a scenegraph 1100. At its root is scene 1120. Scene 1120 has five child nodes:avatar 1102, ball 1110, wall 1104, chair 1112, and table 1106. Ball 1110and wall 1104 may be leaf nodes, while avatar 1102, chair 1112, andtable 1106 have children. Avatar 1102 has two children: back 1122 andvideo 1124 (representing where the video is rendered). Chair 1112 hasthree children: back 1126, leg 1128, and seat 1130. Table 1106 has twochildren: leg 1132 and top 1134. In an additional example (not shown),the same chair 1112 appears multiple times around a table, and chair1112 model may be de-duplicated.

At step 806, a data structure is assembled that identifies the nodeswhich only have children (and sub-children) that are fixed to therespective node. In the example in FIG. 11A, scene 1120 has items withinit that move, such as avatar 1102 and ball 1110. Thus, scene 1120 cannotbe labeled as fixed. However, each of the child nodes can be labeled asfixed. Avatar 1102 can move within a scene. But each of its children,back 1122 and video 1124, only move if avatar 1102 moves. As will bedescribed later, this freeze matrix generated in step 806 can be used tomake transformations and animations more efficient.

At steps 808-812, conference application 310 automatically instancesmodels. Looking to the example in FIG. 11A, tables and chairs typicallyhave four legs. In the VR framework file, chair 1112 and table 1106 mayinclude four separate leg models, each leg model represented by adifferent primitive.

At step 808, conference application 310 identifies duplicate models,such as duplicate leg primitives for chair 1112 and table 1106. Inparticular, conference application 310 may evaluate models referenced inthe VR framework file and determine that the objects referenced in theVR framework file includes a group of repeating, identical threedimensional models in the three dimensional environment.

At 810, conference application 310 hides the duplicate models.Conference application 310 may, for example, change a propertycorresponding to the object in the scene graph to indicate to therendering engine not to render the duplicate models. In the example inFIG. 11A, (though they are not separated in this figure for simplicity),the four separate legs for chair 1112 and the four separate legs fortable 1106 may still be present in the scene graph, but they are markedto indicate to the rendering engine not to render those objects.

At 812, conference application 310 adds a single instruction to draw theduplicate models. In particular, conference application 310 generates asingle instruction specifying a rendering engine to render therepeating, identical three dimensional models in the three dimensionalenvironment. Each of these single instructions will result in a singledraw call to the rendering engine in a web browser. Each singleinstruction indicates to the rendering engine to rasterize the pluralityof the group of duplicate objects. In the example of FIG. 11 , therewould be one instruction for the four legs of chair 1112 and oneinstruction for the four legs of table 1106. In the figure, the fourlegs of chair 1112 are represented by a single leg 1128, and the fourlegs of table 1106 are represented by a single leg 1132.

Rendering Loop

FIG. 9 is a flowchart illustrating a rendering loop 532 for a virtualreality conferencing application. While rendering loop 532 illustrates aparticular sequence of steps, any sequence is possible in variousembodiments. In addition, steps may be done in parallel. For example,shadow maps (which will be described in greater detail) may be renderedin parallel with images being rendered.

At 902, conference application 310 updates entities and components. Thismay be done in a tick or tock function. The updating may involvetranslations, resizing, animation, rotation, or any other alterations toentities and components within the three dimensional environment. Inparticular, at 902, conference application 310 evaluates whether aposition, rotation or scale of an object of represented by eachrespective node in a tree hierarchy needs to be updated. Conferenceapplication 910 traverses the tree hierarchy to make the determinationfor the respective nodes. When the position, rotation and scale of anobject needs to be updated, conference application 310 transforms theobject.

As described above, freeze matrices determined in FIG. 8 at step 806 maybe used to improve speed of step. In particular, conference application310 determines whether an object is labeled as fixed. To make thedetermination, conference application 310 may look up the object in thefreeze matrix previously determined at step 806. When determiningwhether the object is not labeled as fixed, conference application 310may evaluate children of the respective node. And when determiningwhether the object is labeled as fixed and that the position, rotationand scale of the object do not need to be updated, conferenceapplication 310 halts further consideration children of the respectivenode.

When the conference application transforms an object, there may then bea need to determine how the objects interact with one another. Forexample, an avatar may run into a wall, stopping its motion. Physicssimulation is needed to detect and implement these interactions.

FIG. 10 is a flowchart illustrating a method 1000 for optimizing physicssimulation in the virtual environment.

At 1002, conference application 310 determines whether an object isfixed (i.e. static) or dynamic. Static objects are objects that arestationary at fixed positions within the three-dimensional environment.In contrast, dynamic objects are objects that move within theenvironment.

FIG. 11A is a diagram 1100 with a chart listing five exampleobjects—avatar 1102, wall 1104, table 1106, ball 1110, and chair 1112.In this example, the models representing parts of the structure andfurniture—wall 1104, table 1106, and chair 1112—are static. They are atfixed positions within the three dimensional environment and, within theconferencing application, cannot move, transform, or otherwise rotate.

In contrast, avatar 1102, avatar 1108, and ball 1110 are dynamicobjects. Avatar 1102 and avatar 1108 can be moved in response to inputfrom a user. Each of avatar 1102 and avatar 1108 may be used to navigatethe environment by a participant to the conference and represent aposition and orientation of the participant's virtual camera. Ball 1110may be a dynamic object; when another object hits it, it may maintainforward momentum for at least some period of time until its simulatedenergy dissipates.

At step 1004, conference application 310 identifies pairs of objects at1004 and at 1006, conference application 310 determines whether bothobjects in the pair are fixed. When both are fixed, physics simulationbetween the objects is disabled and processing speed is improved. FIG.11B is a diagram 1150 providing an example optimization of the physicssimulation in FIG. 10 . Diagram 1150 is a table with the six exampleobjects—avatar 1102, wall 1109, table 1106, avatar 1108, ball 1110, andchair 1112—listed on the respective rows and columns. Each cellindicates whether at least one of the pair of objects represented by thecell is dynamic. When at least one is dynamic, the cell has a check,indicating that physics simulation is needed to determine whether acollision occurs between the two objects. When both are fixed, the cellhas an X, indicating that both are fixed and therefore no there is noneed for physics simulation to occur.

In this way, for each object in the plurality of objects, conferenceapplication 310 determines whether the respective object is fixed ordynamic. And, for each pair of objects, conference application 310determines whether both objects in the respective pair are fixed. Whenboth objects in the respective pair are determined to be fixed,conference application 310 disables a simulation of physical interactionbetween the two objects at step 1006.

When at least one object in the respective pair is determined to bedynamic, conference application 310 conducts a simulation of physicalinteraction between the two objects to determine whether a collisionoccurs between the objects in the respective pair. When the collision isdetermined to occur, conference application 310 prevents the objects inthe respective pair from penetrating one another.

Turning back to FIG. 9 , once the entities and components are updated atstep 902, at 904, conference application 310 renders the environment.And, at 906, conference application 310 renders avatars, screens, andglass. Steps 904 and 906 are described in greater detail with respect toFIGS. 12-17 .

FIG. 12 is a flowchart illustrating a method rendering a fixedbackground image and accompanying occlusion map.

At 1202, the conference application determines that the virtual camerais moved since the last time it has captured a fixed image. Inparticular, conference application 310 determines whether a virtualcamera has been still or has moved. In one embodiment, step 1202 may betriggered whenever the virtual camera has moved to a new location or hasrotated to a new orientation. In another embodiment, step 1202 may betriggered when the virtual camera has moved to a new location and beenstill for a period of time. As mentioned above, the virtual cameraspecifies a perspective to render the three-dimensional environment. Thethree-dimensional environment includes fixed objects (such as thebuilding and furniture) and dynamic objects (such as other avatars).

FIG. 13 is a diagram 1300 illustrating an example environment. Theexample environment shows the entities in diagram 200: arena 118,presentation screen 122, foliage 114A and 114B, and avatars 102A and102B. Though not shown, the environment may also include a backgroundtexture, such as texture 202. In addition, diagram 1300 includes a wall1302. The environment is captured from the perspective of virtual camera204 that is navigable by a user of conference application 310.

In the example in diagram 1300, arena 118, presentation screen 122,foliage 114A and 114B, and texture 202 (not shown) may be fixed objectsin that they have fixed positions within the environment. In contrast,avatars 102A and 102B are dynamic objects in that their positions withinthe environment can move over time, such as in response to inputs fromthe respective users that those avatars represent.

Turning back FIG. 12 , when the virtual camera is determined to havemoved, steps 1204 and 1216 occur. At 1204, the conference applicationrenders an image illustrating fixed objects of the environment from theperspective of the virtual camera. FIG. 14 illustrates an example ofsuch an image 1400. Image 1400 captures the fixed objects theenvironment 1300 from the perspective of virtual camera 204. Inparticular, image 1400 illustrates arena 118, foliage 114A and 114B, andwall 1302. However, image 1400 lacks avatars 102A and 102B. Even ifthose avatars were in the field of view of virtual camera 204, theywould still not be included in image 1400, because they representdynamic objects.

Because image 1400 is only captured when virtual camera 204 first movesto a new location, image 1400 may be rendered at a higher resolutionthan would normally be rendered had image 1400 need to be rendered everyframe.

Additionally or alternatively, image 1400 may be rendered to have asomewhat wider field of view than virtual camera 204 so that a user canrotate virtual camera 204 at least to some degree without having tore-render image 1400. In that embodiment, image 1400 may be cropped toreflect the new orientation of virtual camera 204.

At 1206, the conference application determines a depth map for therendered image, in this example image 1400 in FIG. 14 . The depth mapspecifies a distance from virtual camera to 204 each respective positionon image 1400. In an embodiment, each pixel on image 1400 may have acorresponding value on the depth map to identify the distance from thefixed object depicted in that pixel to the virtual camera 208 in thevirtual environment. As mentioned above, image 1400 may have a widerfield of view than that of virtual camera 204. In that embodiment, thedepth map may have a wider field of view as well.

Rendering the static image in the occlusion map in this way enables moreefficient handling of rendering. Users tend to stay stationary, so theremay be no need to render fixed objects for every frame. Instead, method1200 allows for the fixed objects to be rendered from the perspective ofthe user only once when the user enters that position, therebyconserving resources.

As mentioned above, mipmapping may be used when rendering fixed (or, forthat matter, dynamic) objects. As mentioned above, mipmapping is atechnique where a high-resolution texture is downscaled and filtered sothat each subsequent mip level is a quarter of the area of the previouslevel. While mipmapping may be applied when four mini textures, it maynot be used when a model is defined by an alpha channel.

Turning back to FIG. 9 , after the fixed objects are rendered at 904,the dynamic objects are rendered at 906. Not only are the dynamicobjects rendered, but also foreground objects that allow light to passthrough, like screens and glass, are rendered at step 906.

FIG. 15 is a flowchart illustrating a method 1500 for rendering dynamicobjects and stitching together the dynamic objects with the backgroundimage using inclusion. Method 1500 may occur in every key frame or everytime the rendering loop is executed, regardless of whether the virtualcamera has moved or has been stationary.

At 1502, the conference application renders an image of dynamic objectsin the environment from the perspective of the virtual camera. Asmentioned above, in addition to dynamic objects, transparent ortranslucent objects in the foreground between the virtual camera and thedynamic object may also be rendered, even though they are fixed. Thesetransparent/translucent objects include, for example, glass.

FIG. 16 illustrates an example image 1600 of two dynamic objects.Continuing from the example in FIG. 13 , two dynamic objects are withinthe field of view of virtual camera 204—avatars 102A-B. Thus, image 1600illustrates avatars 102A and 102B from the perspective of virtual camera204.

Returning to FIG. 15 , at step 1504, the conference applicationdetermines a depth map of the image of the dynamic objects. Looking atthe example provided in FIG. 16 , the depth map determined at step 1504may specify a distance from virtual camera 204 for each respective pixelof image 1600.

At step 1506, the conference application stitches the foreground and thebackground with dynamic objects based on the respective depth maps. Inparticular, the image determined at step 1502, which is executed eachtime the render loop is iterated, is stitched together with the imagegenerated at step 1204, which is executed only when the virtual camerahas changed position. When stitched together, these two images are usedto generate a combined image illustrating both the fixed objects anddynamic objects.

In an embodiment, the stitching at step 1506 involves comparing thedepth map determined at step 1206 and the distance map at step 1504. Thecomparison identifies a portion of the image determined in 1204representing a foreground of the combined image where a fixed objectoccludes a dynamic object. The comparison also identifies a portion ofthe image determined in 1204 representing a background of the combinedimage where the dynamic object occludes the fixed object.

FIG. 17 illustrates an example image 1700 stitching together the dynamicobjects with the background image using the occlusion map. As can beseen in image 1700, wall 1302 occludes avatar 102A. Thus, in thecombined image 1700, avatar 102A is not visible. However, avatar 102B isnot included; thus it is visible in combined image 1700. In addition, inthe background behind avatar 102B, the combined image 1700 has foliage114A and B and arena 118.

As a further optimization of the rendering in steps 904 and 906 of FIG.9 and incorporating the example in FIG. 11A, avatar 1102 and ball 1110are not labeled as fixed. Thus, scene 1120 must be evaluated. However,each of the avatar 1102 and ball 1110 are labeled as fixed. In this way,if avatar 1102 does not move, conference application 310 may recognizeavatar 1102's child nodes—back 1122 and video 1124—will not move, sothere is no need to update transformation matrices during rendering forthose objects. In this way, the number of updates needed is reduced, andprocessing is more efficient.

Returning back to the rendering loop in FIG. 9 , at 908, conferenceapplication 310 renders shadows and superimposes them on the combinedimage generated at step 906. The shadow rendering is discussed belowwith respect to FIGS. 18-23 .

At 910, conference application 310 renders other UI elements. Forexample, turning to FIG. 1 , there are various UI widgets that arerendered in top of the image. These include joystick interface 106 andbuttons 108, 110, and 112. These UI interface elements are rendered atstep 910 and overlaid on top of the rendered and shadowed imagegenerated at 908.

At 912, conference application 310 conducts post-processing. Imagepost-processing may include various operations to make the renderedimage feel more realistic. In one example, a Bloom effect may beapplied. The Bloom effect produces fringes (or feathers) of lightextending from the borders of bright areas in an image, contributing tothe illusion of an extremely bright light overwhelming the camera or eyecapturing the scene. Another example of a post-processing effect isdepth of field blur.

Another example of post-processing may be tone mapping. Tone mapping isa technique used in image processing and computer graphics to map oneset of colors to another to approximate the appearance ofhigh-dynamic-range images in a medium that has a more limited dynamicrange. Display devices such as LCD monitors may have a limited dynamicrange that is inadequate to reproduce the full range of lightintensities present in natural scenes. Tone mapping adjusts the level ofcontrast from a scene's radiance to the displayable range whilepreserving the image details and color appearance.

In a third example, image post-processing may include motion blur.Motion blur is the apparent streaking of moving objects in a photographor a sequence of frames, such as a film or animation. It results whenthe image being recorded changes during the recording of a singleexposure due to rapid movement of the camera or long exposure of thelens.

In various embodiments, any of the post-processing operations of step912 may be applied only to the static background determined, asdescribed above with respect to step 904. This embodiment may saveprocessing power and increase performance.

In this way, conference application 310 produces an output image (e.g.frame) for display to a user. The render loop 530 may repeat so long asthe application is running to enable the user to view and experience thethree dimensional environment during the conference.

Efficient Shadow Rendering

As described above, the render loop generates shadows at step 908.Shadow rendering can be very computationally intensive. Methods areprovided according to the embodiments to produce computationallyefficient, yet realistic, shadows.

FIG. 18 is a flowchart illustrating a method 1800 for rendering shadowmaps at different resolutions. In this way, method 1800 efficientlyrenders shadows in a three-dimensional virtual environment.

Method 1800 starts at step 1802. At 1802, the conference application 310renders a shadow map covering a large area at a low resolution. Theshadow map is rendered from a perspective of a light source in thethree-dimensional virtual environment. In examples, the light source canbe the sun or lamps placed within the three-dimensional virtualenvironment. If there are multiple lights, a separate depth map must beused for each light. The shadow map specifies a distance from the lightsource to objects of the three-dimensional virtual environment within anarea in proximity of a virtual camera. Each pixel in the shadow maprepresents a distance from whatever object is visible to the lightsource. At 1802, the entire environment is rendered from the perspectiveof the light source.

FIG. 19A illustrates creation of one such large depth map in diagram1900. The entire environment is captured at 1902, and the generatedshadow map 1904 specifies a distance from the light source to everythree-dimensional object visible to that light source. In this example,the light source may be the sun, which provides directional light. Thus,an orthographic projection may be used to generate shadow map 1904.

This depth map may be updated anytime there are changes to the light orthe objects in the scene, but the depth map in 1902 may not need to beupdated when the virtual camera moves.

To render the shadow map, conference application 310 samples locationsin the three-dimensional virtual environment by extending rays from theperspective of the light source. According to an embodiment, thissampling can occur at an offset angle to provide for softer shadows.

Offset angle 2010 may be selected to prevent shadow acne. Shadow acneusually is caused by an acute angle between the sun and the object.Acute angles can occur on floors, for example, in sunrises and sunsetsin the three-dimensional environment.

Turning back to FIG. 18 , in this way, a shadow map covering a largearea (perhaps the entire area) of the three-dimensional virtualenvironment is rendered at 1802. In addition to the low resolution,large area shadow map, a second shadow map of an area in proximity ofthe virtual camera may also be determined. This second shadow map may beof a narrow area within the three-dimensional environment, but it willbe at a greater resolution than the shadow map determined at 1802.

At 1804, conference application 310 determines whether the virtualcamera has moved since the last time the higher resolution shadow mapwas determined. In one embodiment, this process may involve determiningwhether any movement (translation, but perhaps not rotation) of thevirtual camera has occurred since the last time a high-resolutionzoomed-in shadow map was determined. In another embodiment, thedetermination may involve ascertaining whether the virtual camera is inwithin a particular distance of its prior location, i.e. where thevirtual camera was located when the high-resolution shadow map wasdetermined. If the virtual camera is determined to have moved, theoperation proceeds to step 1806. Otherwise, the operation proceeds tostep 1808.

At step 1806, the conference application 310 renders a shadow mapcovering a small area in proximity of the virtual camera. In anembodiment, the shadow map rendered at 1806 may be at a higherresolution than the shadow map rendered at step 1802. The offsetsampling technique described with respect to FIG. 20 and step 1802 maybe used to generate the shadow map at 1806.

FIG. 19B is a diagram 1950 illustrating a smaller, zoomed in area 1952used to generate a shadow map 1954. As with diagram 1900 and FIG. 19A,each pixel in the shadow map represents a distance from an object in thethree-dimensional environment to the light source. In one embodiment, at1802, an image of the entire environment is rendered from theperspective of the light source.

FIG. 19A illustrates creation of one such large depth map in diagram1900. The entire environment is captured at 1902 and a shadow map 1904is generated, specifying a distance from the light source to everythree-dimensional object visible to that light source. In this example,the light source may be the sun, which provides directional light. Thus,an orthographic projection may be used to generate shadow map 1954. Asdescribed above, shadow map 1954 may be updated when the virtual cameramoves a sufficient distance. In addition, shadow map 1954 may be updatedany time there are changes to either the light or the objects in thescene.

At 1808, the conference application 310 determines positions of objectsdepicted in a rendered image to the light source. In the method in FIG.9 , for example, for each pixel of the rendered image produced in steps904 and 906, a distance from the object in that scene to the lightsource is determined. In particular, to test a point in the renderedimage, the point's position in the scene coordinates may be transformedinto the equivalent position as seen by the light. This may beaccomplished by a matrix multiplication. The location of the object onthe screen is determined by the usual coordinate transformation, but asecond set of coordinates may be generated to locate the object in lightspace. Using the light space coordinates, a Euclidean distance may bedetermined from the object to the light source.

In a further embodiment, the location of the pixel sampled may be offsetfrom the pixel to be shaded. This is illustrated in FIG. 20A.

FIG. 20A illustrates a diagram illustrating sampling a shadow map at anoffset from the pixel to be sampled in the virtual camera.

In particular, FIG. 20A shows a diagram 200 illustrating athree-dimensional virtual environment from a perspective of a virtualcamera. As depicted in diagram 2000, the three-dimensional virtualenvironment includes a ground 2006 and an obstruction 2004. Castinglight onto ground 2006 and obstruction 2004 is a light source 2002.

Given the arrangement in FIG. 20 , obstruction 2004 should cast a shadowin the rendered, rasterized image as illustrated by rays 2008A, B, andC. That shadow should intersect with ground 2006. The point on ground2006 at which the shadow should end and illumination should begin isillustrated at line 2010. Because the shadow maps do not have perfectresolution, the resulting shadow along line 2010 can have artifacts.These artifacts are sometimes called shadow acne. To reduce shadow acne,an offset is applied between the pixel shaded area and the positiontested in the shadow map.

More specifically, as described above, an image of the three-dimensionalvirtual environment is rendered from the perspective of the virtualcamera. As mentioned above, to determine how to shade each pixel, adistance from a point in the three-dimensional environment depicted ateach pixel to light source 2002 is determined. That point will be testedagainst a distance in a shadow map as described below with respect tosteps 1810 and 1812.

According to the embodiment in FIG. 20A, to determine whether to shadoweach respective pixel in the image, a position depicted at the pixel anda point for which the distance is determined in 1808 and that is testedagainst the shadow map at steps 1810 and 1812 are offset from oneanother. In the example in FIG. 20A, a position 2012 represents aposition in the three-dimensional virtual environment at a pixel that aconference application is determining whether to shadow. Point 2020 is apoint in the three-dimensional environment that is offset from position2012.

In an embodiment, point 2020 and position 2012 are offset from oneanother by two vectors: vector 2014 and vector 2018. Vector 2014 appliesa first offset value in the normal direction from ground 2006. Vector2018 applies a second offset value in a direction towards light source2002. These values can be tuned to reduce the appearance of shadow acne.

When determining whether or not to shade the pixel rendering position2012, the conference application can instead rely on point 2020. Inparticular, turning to FIG. 18 , a distance between light source 2002and point 2020 is determined at step 1808. As will be described ingreater detail below at steps 1810 and 1812, point 2020 is looked up ina shadow map and the distance reported from the shadow map for point2020 is compared against the distance determined at step 1808. When thedistance from the shadow map is less than the distance determined atstep 1808, the pixel at 2012 is rendered as shadowed from light source2002. When the distance from the shadow map is greater than the distancedetermined at step 1808, the pixel at 2012 is rendered as illuminated bylight source 2002.

At 1810, the conference application determines the distance to the valueof the position in the shadow map rendered in 1806. For each pixel inthe rendered image, conference application 310 determines whether thelocation is in proximity of the virtual camera. This can be done usingthe scene coordinates of the rendered image. When the location is inproximity to the rendered image, the distance value determined in 1808is compared to the high-resolution shadow map determined in 1806. Whenthe location is available on the high-resolution shadow map in 1806,then that value is used in step 1810.

When the object in the image is not in proximity of the virtual cameraand thus is not available in the high-resolution shadow map in 1806, atstep 1812, the conference application compares the distance to the valueof the position in the shadow map rendered in step 1802. As describedabove with respect to FIG. 20A, a shadow map can be sampled from anoffset position.

A binary result in steps 1810 and 1812—shadowed or illuminated—cansometimes also result in unwanted artifacts around the edge of a shadow,such as a shadow cast by obstruction 2004. To soften the edge of ashadow, embodiments may sample a plurality of points, as illustrated inFIGS. 20B and C.

FIG. 20B illustrates scene 2050 from a perspective of light source 2002.Scene 2050 includes position 2012 and point 2020 determined by theoffset as described above with respect to FIG. 20A. As illustrated inFIG. 20 B, the conference application selects, from the shadow map, aplurality of pixels in the shadow map surrounding point 2020 aredetermined as illustrated by pixels 2022A, B, C, and D. For each pixel,a distance stored at the pixel as a tree for shadow map is retrieved.

As described above, at step 1808, a distance from point 2020 to lightsource 2002 is determined. The distance between point 2020 and lightsource 2002 is compared to each of the retrieved distances for pixels2022A, B, C, and D. The amount of distances retrieved from the shadowmap that exceeds the distance from point 2020 to light source 2002 iscounted. This quantity may be used to determine the degree to whichshading is applied, as described below with respect to step 1814. Thismay be done using a simple ratio or average.

In the example in FIG. 20B, the retrieved shadow map values for pixels2022B, C, and D may be less than the distance determined for point 2020,because those pixels intersect with obstruction 2004 before reachingpoint 2020. On the other hand, the retrieved shadow map values for pixel2022A may be greater than the distance determined for point 2020,because that pixel does not intersect with obstruction 2004 andcontinues to intersect with ground 2006. Thus, the ratio may be 75%shading to be applied to point 2012.

FIG. 20 C illustrates a zoomed-in view of scene 2050. As illustrated inFIG. 20 C, the sample pixels 2022A,B,C, and D may be in a rotated squarepattern. According to an embodiment, the sampling occurs at an offsetangle 2052 from line 2054 parallel to the ground. Offset angle 2052represents an angle between line 2054 and a line 2056 that connectssampling points 2022D and 2022A.

At 1814, the comparison performed at steps 1810 and 1812 is used toshade the rendered image. A shader may be selected based on whether ornot the pixel is in proximity of the virtual camera. When the positionis not in proximity of the virtual camera, a simplified shader thatrequires less processing power may be used. The simplified shader mayalso be selected based on the property selected in FIG. 7 . Additionallyor alternatively, the setting described above with respect to FIG. 7 maycause shadow rendering to be disabled entirely. In examples, the shadingalgorithms can be percentage closer filtering shading and pixelatedshading, where percentage closer filtering is the more computationallyintensive. As described above with respect to FIGS. 20B and C, theshading can be done based on an aggregate of a plurality of samples fromthe shadow map.

FIG. 21 illustrates a diagram 2100 illustrating an example of fadingbetween shadows generated from shadow maps of different resolutions.Shadow 2102 is far from the virtual camera, those shadows are generatedusing wide area shadow maps at a lower resolution and using a shaderthat is simpler to execute. Shadow 2104 is close to the virtual camera,those shadows are generated using narrower area shadow maps at a higherresolution and using a shader that is more computationally intensive.Between the two regions is a transition area 2104 where the two shadowsare blended (or faded) together to make a smooth transition.

FIGS. 22 and 23 illustrate how shadow maps are used to shade a scene.FIG. 22 illustrates a diagram 2200 illustrating a rendered image andFIG. 23 illustrates a diagram 2300 showing the shadow applied to therendered image.

Volumetric Light Scattering

According to embodiments, during the rendering process, the conferenceapplication generates a foreground light scattering effect which createsthe appearance of fog for participants. This improves the appearance ofthe scene as rays of light become visible and provide increasedperception of depth and scale. In different embodiments, the conferenceapplication may apply this light scattering effect during thepost-processing of step 912 of FIG. 9 or in the rendering steps 904 or906 of FIG. 9 .

FIG. 24A illustrates a diagram 2400 showing a three dimensional virtualenvironment with light source 2002 and obstruction 2004. In addition,diagram 2400 includes objects 2405 and 2408 and a virtual camera 2001.

As described above with respect to FIGS. 19A-B, 20A-C and 21, a shadowmap is rendered of at least a portion of the three-dimensional virtualenvironment from a perspective of light source 2002 in thethree-dimensional virtual environment. The shadow map specifies aplurality of distances from the light source to objects of thethree-dimensional virtual environment, including obstruction 2004 andobjects 2405 and 2408.

The conference application renders an image of the three-dimensionalvirtual environment from the perspective of virtual camera 2001. Theconference application renders an image of the three-dimensional virtualenvironment from the perspective of virtual camera 2001. As part of thisrendering process rasterization takes place. During this rasterizationprocess for every pixel on the screen a position and color iscalculated. Pixels on the screen are first calculated by rasterization,giving them a color and a position. Then, a ray is calculated from thepixel to the virtual camera. The conference application extends aplurality of rays from virtual camera 2001. In FIG. 24A, those rays areillustrated, for example, as rays 2412A, B, and C. Those extended raysare intersected with objects in the three-dimensional virtualenvironment.

According to an embodiment, a scattering effect is supplied to therendered image. To apply the scattering effect, for respective pixels ofthe image, a plurality of points are identified in the three-dimensionalvirtual environment along a ray that is extended from respective pixelof an object to the virtual camera. The points may be sampled at regularintervals. As illustrated in diagram 2400, points 2420A, B, C, and D areidentified along ray 2410A; points 2422A, B, C, and D are sampled alongray 2410B; and points 2424A, B, C, and D are sampled along ray 2410C.

Once the plurality points are identified, they are assessed against theshadow map similar to the shadow processing described above. For each ofthe plurality of points (in diagram 2400, points 2420A-D, points 2422A-Dand points 2440A-D), a distance is selected from the shadow map positionat the respective point. And, for each of the plurality of points (indiagram 2400, points 2420A-D, points 2422A-D and points 2440A-D), adistance from the points to light source 2002 is determined. Thedistance from the shadow map is compared to the determined distance tothe light source. Based on the comparison, the application is able todetermine whether each respective point is exposed to the light source.In diagram 2400, points 2420A, 2420B, 2422A, 2424A, 2422D, and 2424D areexposed to light source 2002, and points 2420C, 2420D, 2422C, 2422D,2424C, and 2424D are not.

For each ray, a number of the plurality of points are determined to beexposed to the light source. Based on that number, a scattering effectis applied at the respective pixel for the ray. In an embodiment, aratio of the number of points exposed to the light source to a number ofpoints sampled along the ray is determined, and that ration is used toapply the scattering effect. In this way, a fog effect may bedetermined. In additional or alternative, the scattering effect may beapplied based at least in part on at least one of: (i) intensity of thelight source, (ii) intensity of ambient light in the three-dimensionalvirtual environment, (iii) a value indicating a desired density of thefog, (iv) a value indicating a desired brightness of the fog (e.g.,white or black smoke), or (v) a length of the ray. In furtherembodiments, for respective points 2420A-D, points 2422A-D and points2440A-D, the conference application steps from the pixel on the screentowards the camera, and at every step the conference application usesthe light coming from the direction of the pixel so far, the outgoingscattering, absorption, emission, and incoming (sun)light to determinethe scattering effect.

As described above, the plurality of points are sampled along the ray atregular intervals between the virtual camera and an intersection of aray with an object in a three-dimensional environment. In an embodiment,when a distance, between the virtual camera and an intersection of theray with an object exceed a maximum distance, the plurality of pointsare only sampled up to the maximum distance.

This is illustrated in FIG. 24B illustrating a diagram 2400. Diagram2400 includes a ray 2410 and a plurality of points 2426A, 2426B, 2426C,and 2426D sampled up to a maximum distance 2442. Capping the sampledpoints to the maximum distance may allow for strong fog effects up closewhile not completely obscuring objects in the distance.

In a further embodiment, an offset value may be used to determined whereto sample points along the ray. This is illustrated in FIG. 24C whichillustrates a diagram 2460. Diagram 2460 illustrates an offset 2462A forray 2410A, an offset 2462B for ray 2410B, an offset 2462C for ray 2410C,and an offset 2462D for ray 2410D. The conference application determinesa portion of the ray offset from the object and samples the plurality ofpoints along the portion of the ray at regular interviews.

In one embodiment, the offset value may be determined randomly as noiseto make for a softer fog effect. The noise may be blue noise, that isnoise without a low frequency component. This blue noise evens out thesampling errors and gives a pleasing result. To prevent the structure ofthis blue noise texture from being noticeable when the camera rotates oris moved, one of a number of different noise textures may be selectedevery frame as long as the camera is moving. When the camera stops, thenoise also stops changing in order to give a calmer view. Additionallyor alternatively, a blur may be performed on the calculated fog toremove noise.

In another embodiment, the offset value varies over time to create anappearance of precipitation in the environment. To create this effect, ashadow map or depth map may be generated to point in the direction theprecipitation is falling. This can be straight down, or slightly angledas caused by the wind. The general volumetric shadow algorithm discussedabove is used to determine how much rain should be visible for aspecific pixel on the screen. Finally, instead of using noise for theoffset, animated streaks that move across the screen in the directionthe precipitation is falling are used. In different exampleimplementations, this can create an appearance of rain, snow, hail,falling ash, or blowing dust. Additional, this depth map can be used todynamically determine which parts of the scene should be wet (andreflective) and which ones should be rendered dry.

In different embodiments, the scattering effect may be determined at alower resolution to increase performance or at a higher resolution toimprove quality.

System Architecture

FIG. 25 is a diagram 2500 illustrating components of conferenceapplication 310A in greater detail. Conference application 310A includesa rendering engine 2502, a VR framework 2504, a static rendering module2506, a physics sleep module 2508, a model optimizer 2510, a graphicsadjuster 2512, shadow map generator 2514, a shader 2516, and a streammanager 2518.

Rendering engine 2502 includes a rendering a rendering library such as athree.js rendering library. Three.js is a cross-browser JavaScriptlibrary and application programming interface (API) used to create anddisplay animated 3D computer graphics in a web browser using WebGL.Three.js allows the creation of graphical processing unit(GPU)-accelerated 3D animations using the JavaScript language as part ofa website without relying on proprietary browser plugins.

Rendering engine 2502 may have a variety of rendering capabilitiesincluding, but not limited to:

-   -   Effects: Anaglyph, cross-eyed, and parallax barrier.    -   Scenes: add and remove objects at run-time; fog.    -   Cameras: perspective and orthographic; controllers: trackball,        FPS, path, and more.    -   Animation: armatures, forward kinematics, inverse kinematics,        morph, and keyframe.    -   Lights: ambient, direction, point, and spot lights; casting and        receiving shadows.    -   Materials: Lambert, Phong, smooth shading, textures, and more.    -   Shaders: access to full OpenGL Shading Language (GLSL)        capabilities: lens flare, depth pass, and extensive        post-processing library.    -   Objects: meshes, particles, sprites, lines, ribbons, bones, and        more, all with Level of detail.    -   Geometry: plane, cube, sphere, torus, 3D text, and more; lathe,        extrude, and tube modifiers.    -   Data loaders: binary, image, JSON, and scene.    -   Utilities: full set of time and 3D math functions including        frustum, matrix, quaternion, UVs, and more.    -   Export and import: utilities to create Three.js-compatible JSON        files from within Blender, openCTM, FBX, Max, and OBJ.    -   Support: API documentation is under construction. A public forum        and wiki is in full operation.    -   Virtual and Augmented Reality via WebXR.

As described above throughout, using these capabilities, renderingengine 2502 renders, from a perspective of a virtual camera of the userof device 306A, for output to display 2610, the three-dimensionalvirtual space including the texture-mapped three-dimensional models ofthe avatars for respective participants located at the received,corresponding position and oriented at the direction. Renderer 2618 alsorenders any other three-dimensional models including for example thepresentation screen.

VR framework 2504 is a framework that provides VR capabilities. In anexample, VR framework 2504 includes an A-Frame VR framework. A-Frame isan open-source web framework for building virtual reality (VR)experiences. A-Frame is an entity component system framework for aJavaScript rendering engine that allows developers to create 3D andWebVR scenes using HTML

Static rendering module 2506 provides for static rendering of abackground image and use of and occlusion map to determine what portionsof the image are background in which portions are foreground. This isdescribed above, for example, with respect to FIGS. 12-17 .

Physics sleep module 2508 disables physics determination for staticobjects. This is described above, for example, with respect to FIGS. 10and 11B.

Model optimizer 2510 provide certain optimizations as the A-frame modelunderstood by VR framework 2504 is transformed into a scene graphunderstood by rendering engine 2502. These optimizations are described,for example, with respect to FIG. 5B and FIG. 8 .

Graphics adjuster 2512 adjusts graphics processing based on the propertysetting discussed above throughout and provided as an example in FIG. 7. For example, graphics adjuster 2512 may request different qualitytextures from server 302 depending on the setting selected.

Shadow map generator 2514 generates cascading shadow maps as describedabove with respect to FIGS. 18, 19A-B and 20. As described above, shadowmaps describe a depth of different objects of in a virtual environmentfrom the perspective of a light source. This shadow map is used byshader 2516 to shade the image.

Shader 2516 uses the shadow maps to shade the image as discussed abovefor example with respect to FIGS. 21-23 .

Stream manager 2518 sends video streams and receives video streams fromother users via an intermediate server 302. As described above, streammanager 2518 may include built-in web RTC capabilities.

FIG. 26 illustrates a system diagram of the client and server device ina video conference application in a virtual environment.

Device 306A is a user computing device. Device 306A could be a desktopor laptop computer, a smartphone, a tablet, or a wearable computingdevice (e.g., watch or head mounted device). Device 306A includes amicrophone 2602, camera 2604, stereo speaker 2606, and input device2612. Not shown, device 306A also includes a processor and persistent,non-transitory and volatile memory. The processors can include one ormore central processing units, graphic processing units or anycombination thereof.

Microphone 2602 converts sound into an electrical signal. Microphone2602 is positioned to capture speech of a user of device 306A. Indifferent examples, microphone 2602 could be a condenser microphone,electret microphone, moving-coil microphone, ribbon microphone, carbonmicrophone, piezo microphone, fiber-optic microphone, laser microphone,water microphone, or MEMS (microelectromechanical systems) microphone.

Camera 2604 captures image data by capturing light, generally throughone or more lenses. Camera 2604 is positioned to capture photographicimages of a user of device 306A. Camera 2604 includes an image sensor(not shown). The image sensor may, for example, be a charge coupleddevice (CCD) sensor or a complementary metal oxide semiconductor (CMOS)sensor. The image sensor may include one or more photodetectors thatdetect light and convert to electrical signals. These electrical signalscaptured together in a similar timeframe comprise a still photographicimage. A sequence of still photographic images captured at regularintervals together comprise a video. In this way, camera 2604 capturesimages and videos.

Stereo speaker 2606 is a device which converts an electrical audiosignal into a corresponding left-right sound. Stereo speaker 2606outputs the left audio stream and the right audio stream generated by anaudio processor 2620 (below) to be played in stereo to device 306A'suser. Stereo speaker 2606 includes both ambient speakers and headphonesthat are designed to play sound directly into a user's left and rightears. Example speakers include: moving-iron loudspeakers; piezoelectricspeakers; magnetostatic loudspeakers; electrostatic loudspeakers; ribbonand planar magnetic loudspeakers; bending wave loudspeakers; flat panelloudspeakers; heil air motion transducers; transparent ionic conductionspeakers; plasma arc speakers; thermoacoustic speakers; rotary woofers;and moving-coil, electrostatic, electret, planar magnetic, and balancedarmatures.

Network interface 2608 is a software or hardware interface between twopieces of equipment or protocol layers in a computer network. Networkinterface 2608 receives a video stream from server 302 for respectiveparticipants for the meeting. The video stream is captured from a cameraon a device of another participant to the video conference. Networkinterface 2608 also received data specifying a three-dimensional virtualspace and any models therein from server 302. For each of the otherparticipants, network interface 2608 receives a position and directionin the three-dimensional virtual space. The position and direction areinput by each of the respective other participants.

Network interface 2608 also transmits data to server 302. It transmitsthe position of the user of device 306A's virtual camera used byrenderer 2618 and it transmits video and audio streams from camera 2604and microphone 2602.

Display 2610 is an output device for presentation of electronicinformation in visual or tactile form (the latter used for example intactile electronic displays for blind people). Display 2610 could be atelevision set; a computer monitor; a head-mounted display; a heads-updisplay; an output of a augmented reality or virtual reality headset; abroadcast reference monitor; a medical monitor; a mobile display (formobile devices); or a smartphone display (for smartphones). To presentthe information, display 2610 may include an electroluminescent (ELD)display, liquid crystal display (LCD), light-emitting diode (LED)backlit LCD, thin-film transistor (TFT) LCD, light-emitting diode (LED)display, OLED display, AMOLED display, plasma (PDP) display, or quantumdot (QLED) display.

Input device 2612 is a piece of equipment used to provide data andcontrol signals to an information processing system such as a computeror information appliance. Input device 2612 allows a user to input a newdesired position of a virtual camera used by renderer 2618, therebyenabling navigation in the three-dimensional environment. Examples ofinput devices include keyboards, mouse, scanners, joysticks, andtouchscreens.

Web browser 308A and conference application 310A were described above.

Server 302 includes an attendance notifier 2622, a stream adjuster 2624,and a stream forwarder 2626.

Attendance notifier 2622 notifies conference participants whenparticipants join and leave the meeting. When a new participant joinsthe meeting, attendance notifier 2622 sends a message to the devices ofthe other participants to the conference indicating that a newparticipant has joined. Attendance notifier 2622 signals streamforwarder 2626 to start forwarding video, audio, and position/directioninformation to the other participants.

Stream adjuster 2624 receives a video stream captured from a camera on adevice of a first user. Stream adjuster 2624 determines an availablebandwidth to transmit data for the virtual conference to the seconduser. It determines a distance between a first user and a second user ina virtual conference space, and it apportions the available bandwidthbetween the first video stream and the second video stream based on therelative distance. In this way, stream adjuster 2624 prioritizes videostreams of closer users over video streams from farther ones.Additionally or alternatively, stream adjuster 2624 may be located ondevice 306A, perhaps as part of web application 310A.

Stream forwarder 2626 broadcasts position/direction information, video,audio, and screen share screens it receives (with adjustments made bystream adjuster 2624). Stream forwarder 2626 may send information to thedevice 306A in response to a request from conference application 310A.Conference application 310A may send that request in response to thenotification from attendance notifier 2622.

Model provider 2630 provides different textures from model repository2632 as described above with respect to FIG. 7 .

Network interface 2628 is a software or hardware interface between twopieces of equipment or protocol layers in a computer network. Networkinterface 2628 transmits the model information to devices of the variousparticipants. Network interface 2628 receives video, audio, and screenshare screens from the various participants.

A screen capturer 2614, a texture mapper 2616, a renderer 2618, an audioprocessor 2620, an attendance notifier 2622, a stream adjuster 2624, anda stream forwarder 2626 can each be implemented in hardware, software,firmware, or any combination thereof.

Identifiers, such as “(a),” “(b),” “(i),” “(ii),” etc., are sometimesused for different elements or steps. These identifiers are used forclarity and do not necessarily designate an order for the elements orsteps.

The present invention has been described above with the aid offunctional building blocks illustrating the implementation of specifiedfunctions and relationships thereof. The boundaries of these functionalbuilding blocks have been arbitrarily defined herein for the convenienceof the description. Alternate boundaries can be defined so long as thespecified functions and relationships thereof are appropriatelyperformed.

The foregoing description of the specific embodiments will so fullyreveal the general nature of the invention that others can, by applyingknowledge within the skill of the art, readily modify and/or adapt forvarious applications such as specific embodiments, without undueexperimentation and without departing from the general concept of thepresent invention. Therefore, such adaptations and modifications areintended to be within the meaning and range of equivalents of thedisclosed embodiments based on the teaching and guidance presentedherein. It is to be understood that the phraseology or terminologyherein is for the purpose of description and not of limitation, suchthat the terminology or phraseology of the present specification is tobe interpreted by the skilled artisan in light of the teachings andguidance.

The breadth and scope of the present invention should not be limited byany of the above-described exemplary embodiments, but should be definedonly in accordance with the following claims and their equivalents.

What is claimed is:
 1. A computer-implemented method for efficientlyrendering shadows in a three-dimensional virtual environment,comprising: rendering, at a first resolution, a first shadow map of afirst area of the three-dimensional virtual environment from aperspective of a light source in the three-dimensional virtualenvironment, the first shadow map specifying a plurality of firstdistances from the light source to objects of the three-dimensionalvirtual environment and the first area being in proximity of a virtualcamera; rendering, at a second resolution, a second shadow map of asecond area of the three-dimensional virtual environment from theperspective of the light source in the three-dimensional virtualenvironment, the second shadow map specifying a plurality of seconddistances from the light source to objects of the three-dimensionalvirtual environment, wherein the second resolution is less than thefirst resolution and the second area is larger than the first area;rendering an image of the three-dimensional virtual environment from theperspective of the virtual camera; for respective pixels of the image:determining a third distance of a position depicted in the respectivepixel to the light source; when the respective pixel depicts the firstarea, selecting, from the first shadow map, which first distancecorresponds to the respective pixel; when the respective pixel depictsthe second area, selecting, from the second shadow map, which seconddistance corresponds to the respective pixel; when the third distanceexceeds the selected first or second distance, shading the respectivepixel; determining a fourth distance in the three-dimensional virtualenvironment between a current location of the virtual camera and wherethe virtual camera was when the first shadow map was rendered; when thefourth distance exceeds a threshold: moving the first area to be inproximity of the virtual camera at the current location; andre-rendering, at the first resolution, the first shadow map of the firstarea of the three-dimensional virtual environment from the perspectiveof the light source in the three-dimensional virtual environment.
 2. Themethod of claim 1, comprising: when the respective pixel depicts atransition area between the first and second areas, fading between theareas.
 3. The method of claim 1, wherein the shading comprises: when therespective pixel depicts the first area, applying a first shadingalgorithm to alter the respective pixel; and when the respective pixeldepicts the second area, applying a second shading algorithm to alterthe respective pixel, the second shading algorithm being different fromthe first shading algorithm.
 4. The method of claim 3, wherein the firstshading algorithm is more computationally intensive than the secondshading algorithm.
 5. The method of claim 4, wherein the first shadingalgorithm is percentage closer filtering.
 6. The method of claim 5,wherein the second shading algorithm is pixelated.
 7. The method ofclaim 1, further comprising presenting the rendered image to a firstparticipant to a conference, wherein the virtual camera is navigablewithin the three-dimensional virtual environment by the firstparticipant.
 8. The method of claim 7, wherein the three-dimensionalvirtual environment includes a representation of a second participant tothe conference, the representation being navigable within thethree-dimensional virtual environment by the second participant andhaving mapped thereto video captured of the second participant.
 9. Themethod of claim 1, wherein the rendering the first and second shadowmaps, the rendering the image and the re-rendering occur in anapplication executed on a web browser.
 10. A computer-readablenon-transitory storage medium comprising instructions which, whenexecuted by a computer, cause the computer to carry out operations forefficiently rendering shadows in a three-dimensional virtualenvironment, the operations comprising: rendering, at a firstresolution, a first shadow map of a first area of the three-dimensionalvirtual environment from a perspective of a light source in thethree-dimensional virtual environment, the first shadow map specifying aplurality of first distances from the light source to objects of thethree-dimensional virtual environment and the first area being inproximity of a virtual camera; rendering, at a second resolution, asecond shadow map of a second area of the three-dimensional virtualenvironment from the perspective of a light source in thethree-dimensional virtual environment, the second shadow map specifyinga plurality of second distances from the light source to objects of thethree-dimensional virtual environment, wherein the second resolution isless than the first resolution and the second area is larger than thefirst area; rendering an image of the three-dimensional virtualenvironment from the perspective of the virtual camera; for respectivepixels of the image: determining a third distance of a position depictedin the pixel to the light source; when the respective pixel depicts thefirst area, selecting, from the first shadow map, which first distancecorresponds to the respective pixel; when the respective pixel depictsthe second area, selecting, from the second shadow map, which seconddistance corresponds to the respective pixel; when the third distanceexceeds the selected first or second distance, shading the respectivepixel; determining a fourth distance in the three-dimensional virtualenvironment between a current location of the virtual camera and wherethe virtual camera was when the first shadow map was rendered; when thefourth distance exceeds a threshold: moving the first area to be inproximity of the virtual camera at the current location; andre-rendering, at the first resolution, the first shadow map of the firstarea of the three-dimensional virtual environment from the perspectiveof the light source in the three-dimensional virtual environment. 11.The computer-readable non-transitory storage medium of claim 10,comprising: when the respective pixel depicts a transition area betweenthe first and second areas, fading between the areas.
 12. Thecomputer-readable non-transitory storage medium of claim 10, wherein theshading comprises: when the respective pixel depicts the first area,applying a first shading algorithm to alter the respective pixel; andwhen the respective pixel depicts the second area, applying a secondshading algorithm to alter the respective pixel, the second shadingalgorithm being different from the first shading algorithm.
 13. Thecomputer-readable non-transitory storage medium of claim 12, wherein thefirst shading algorithm is more computationally intensive than thesecond shading algorithm.
 14. The computer-readable non-transitorystorage medium of claim 13, wherein the first shading algorithm ispercentage closer filtering.
 15. The computer-readable non-transitorystorage medium of claim 14, wherein the second shading algorithm ispixelated.
 16. The computer-readable non-transitory storage medium ofclaim 10, further comprising presenting the rendered image to a firstparticipant to a conference, wherein the virtual camera is navigablewithin the three-dimensional virtual environment by the firstparticipant.
 17. The computer-readable non-transitory storage medium ofclaim 16, wherein the three-dimensional virtual environment includes arepresentation of a second participant to the conference, therepresentation being navigable within the three-dimensional virtualenvironment by the second participant and having mapped thereto videocaptured of the second participant.
 18. The computer-readablenon-transitory storage medium of claim 16, wherein the rendering thefirst and second shadow maps, the rendering the image and there-rendering occur in an application executed on a web browser.
 19. Asystem for efficiently rendering shadows in a three-dimensional virtualenvironment, comprising: a memory; a processor coupled to the memory; ashadow map renderer executable by the processor and configured to: (i)render, at a first resolution, a first shadow map of a first area of thethree-dimensional virtual environment from a perspective of a lightsource in the three-dimensional virtual environment, the first shadowmap specifying a plurality of first distances from the light source toobjects of the three-dimensional virtual environment and the first areabeing in proximity of a virtual camera, and (ii) render, at a secondresolution, a second shadow map of a second area of thethree-dimensional virtual environment from the perspective of a lightsource in the three-dimensional virtual environment, the second shadowmap specifying a plurality of second distances from the light source toan object of the three-dimensional virtual environment, wherein thesecond resolution is less than the first resolution and the second areais larger than the first area; a rendering engine executable by theprocessor and configured to render an image of the three-dimensionalvirtual environment from the perspective of the virtual camera; and ashader executable by the processor and configured to, for respectivepixels of the image: (i) determining a third distance of a positiondepicted in the pixel to the light source; (ii) when the respectivepixel depicts the first area, selecting, from the first shadow map,which first distance corresponds to the respective pixel; (iii) when therespective pixel depicts the second area, selecting, from the secondshadow map, which second distance corresponds to the respective pixel;(iv) when the third distance exceeds the selected first or seconddistance, shading the respective pixel; (v) determining a fourthdistance in the three-dimensional virtual environment between a currentlocation of the virtual camera and where the virtual camera was when thefirst shadow map was rendered; when the fourth distance exceeds athreshold: (vi) moving the first area to be in proximity of the virtualcamera at the current location; and (vii) re-rendering, at the firstresolution, the first shadow map of the first area of thethree-dimensional virtual environment from the perspective of the lightsource in the three-dimensional virtual environment.
 20. The system ofclaim 19, further comprising a display that presents the rendered imageto a first participant to a conference, wherein the virtual camera isnavigable within the three-dimensional virtual environment by the firstparticipant, wherein the three-dimensional virtual environment includesa representation of a second participant to the conference, therepresentation being navigable within the three-dimensional virtualenvironment by the second participant and having mapped thereto videocaptured of the second participant.